using Microsoft.Ccr.Core;
using Microsoft.Dss.Core.Attributes;
using Microsoft.Dss.ServiceModel.Dssp;
using Microsoft.Robotics.PhysicalModel.Proxy;

using System;
using System.Collections.Generic;
using System.ComponentModel;
using W3C.Soap;

using lynx6arm = ProMRDS.Simulation.LynxL6Arm;
using armproxy = Microsoft.Robotics.Services.ArticulatedArm.Proxy;

namespace ProMRDS.Simulation.LynxL6Arm
{  
    [DataContract]
    public class Lynx6ArmState : armproxy.ArticulatedArmState
    {
        internal const int NUM_JOINTS = 6;

        //Each angle ranges from -90 to 90
        //Each joint speed is in uS per second 
        private int _gripperAngle;
        private int _gripperSpeed;

        [DataMember]
        public int GripperAngle
        {
            get { return _gripperAngle; }
            set { _gripperAngle = value; }
        }

        [DataMember]
        public int GripperSpeed
        {
            get { return _gripperSpeed; }
            set { _gripperSpeed = value; }
        }

        // The maximum angular speed that is set in degrees/second
        // This sets a limit on how fast the arm can move
        // The arm service calculates the necessary time period for
        // each move in order to avoid sudden jumps
        private float _maxAngularSpeed;

        [DataMember]
        public float MaxAngularSpeed
        {
            get { return _maxAngularSpeed; }
            set { _maxAngularSpeed = value; }
        }

        public Lynx6ArmState()
            : base()
        {
            _gripperAngle = 0;
            _gripperSpeed = 500;
            _maxAngularSpeed = 20.0f;
        }
    }
}
